
var MobileRedirect = new (function() {
	
	var ID = {
		ISMOBILE: '#global_ismobile',
		NOAPPREDIRECT: '#global_noappredirect'
	}
	
	this.init = function() {
		var ismobile = $(ID.ISMOBILE).val();
		var noappredirect = $(ID.NOAPPREDIRECT).val();
		if (ismobile == "1" && noappredirect == "0") {
			if (confirm("Voulez-vous être redirigé vers la webapp?")) {
				window.location = "http://japword-app.valhallakeys.fr";
			} else {
				window.location += "?noappredirect=1";
			}
		}
	};
	
	$(document).ready(this.init);
});